Xbasic

MONTH Function

Syntax

Month_Number as N = MONTH( Date as D)

Month_Number as N = MONTH( date_time as T)

Arguments

date

A variable containing a date value or a character string containing a legitimate representation of a date value ( ISDATE ( Date_Value ) = .T.).

date_time

A variable containing a date-time value (type T).

Description

Returns the number of the month in a date.

Discussion

MONTH() returns an integer equal to the month number (1-12) of the specified Date or Date_Time value..

Example

month(START) -> 3, if START contains 03/10/88
month( ctod( "12/12/88") ) ->  12

The following example computes the current quarter.

ceiling(month(date() )/3)

See Also